package com.onpositive.wiki3.catmodels;

import java.util.HashSet;

import com.onpositive.wiki3.db.catmodel.Category;

public class ClassificatorCategoryModel extends CoreBasedModel {

	public static HashSet<String> classificators = new HashSet<String>();

	static {
		classificators.add("in");
		classificators.add("of");
		classificators.add("from");
		classificators.add("at");
		classificators.add("after");
		classificators.add("by");
		classificators.add("on");
		classificators.add("about");
		classificators.add("involving");
		classificators.add("to");
		//classificators.add("assotiated_with");
		//classificators.add("to");
	}

	@Override
	public int score(Category cat) {
		String string = cat.toString();
		for (String s : cat.getTokens()) {
			if (classificators.contains(s)) {
				cat.setTag(ICategoryModel.CLASSIFICATOR);
				return Integer.MAX_VALUE;
			}
		}
		if (string.startsWith("types_of")) {
			cat.setTag(ICategoryModel.CLASSIFICATOR);
			return Integer.MAX_VALUE;
		}
		return 0;
	}

	@Override
	public String name() {
		return "classificator";
	}

	@Override
	public boolean isPossibleCategorization(Category cat) {
		return true;
	}


}